#!/usr/bin/python3

import sys
import os


bs = 10240
ifile = os.fdopen(sys.stdin.fileno(), 'rb')
ofile = open('/tmp/uploaded', 'wb')

while True:
    chunk = ifile.read(bs)
    if not chunk:
        break
    ofile.write(chunk)

print('Content-Type: text/plain\n\n', end='')
print('upload success')
